package cn.itcast.feign;

import cn.config.Configuration2;
import cn.itcast.hystrix.HystrixClientFallback2;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @Author: zhaojie
 * @Date: Created in 16:40 2018/7/21
 * @Description: 禁用hystrix Fallback的支持 禁用需要在configuration的配置类中禁用
 */
@FeignClient(name = "feignClient2", url = "http://localhost:8764/", configuration = Configuration2.class,fallback = HystrixClientFallback2.class)
public interface FeignClient2 {

    /**
     * 全部使用name + url +configuration 的情况下 可以直接使用MVC的注解
     *
     * @param serviceName
     * @return http://localhost:8764/eureka/apps/{serviceName}
     */
    @RequestMapping(value = "/eureka/apps/{serviceName}")
    String findServiceInfoFromEurekaByServiceName(@PathVariable("serviceName") String serviceName);

}
